

client/Admin/verb

	// User list grid for mute/kick
	adminQuickButton()
		set hidden = 1
		if(winget(src,"Admin_Quick","is-visible") == "true")
			winset(src,"Admin_Quick","is-visible=false")
		else
			winset(src,"Admin_Quick","is-visible=true;pos=[WINDOW_LOCATION]")
			adminUpdateQuick()

	// System logs
	adminLogButton()
		set hidden = 1
		if(winget(src,"Admin_Log","is-visible") == "true")
			winset(src,"Admin_Log","is-visible=false")
		else
			winset(src,"Admin_Log","is-visible=true;pos=[WINDOW_LOCATION]")



	// User IM logs
	adminIMLogButton()
		set hidden = 1
		if(winget(src,"Admin_UserLog","is-visible") == "true")
			winset(src,"Admin_UserLog","is-visible=false")
		else
			winset(src,"Admin_UserLog","is-visible=true;pos=[WINDOW_LOCATION]")



	// Grids for removing mutes/bans
	adminForgiveButton()
		set hidden = 1
		if(winget(src,"Admin_Forgive","is-visible") == "true")
			winset(src,"Admin_Forgive","is-visible=false")
		else
			winset(src,"Admin_Forgive","is-visible=true;pos=[WINDOW_LOCATION]")
			AdminUpdateForgive()


	// Main server settings
	adminSettingsButton()
		set hidden = 1

		if(winget(src,"Admin_Settings","is-visible") == "true")
			winset(src,"Admin_Settings","is-visible=false")
		else
			winset(src,"Admin_Settings","is-visible=true")
			winset(src,"Admin_Settings","size=625x455;pos=[WINDOW_LOCATION]")

			if(Reboot)
				winset(src,"Admin_Settings.admin_ServerStatus","text=\"Server will reboot in [RebootTimer] seconds.\"")
				winset(src,"Admin_Settings.admin_inputtime","text=0")
			else
				winset(src,"Admin_Settings.admin_ServerStatus","text=\"Server is currently running.\"")
				winset(src,"Admin_Settings.admin_inputtime","text=[RebootTimer]")


			winset(src,"Admin_Settings.admin_charlimit","text=[LengthLimit]")
			src<<output(ConversationTopic,"Admin_Settings.admin_topic")


client/proc
	adminUpdateQuick()
		set hidden = 1
		var
			style = "font-weight: bold; font-size: 12px;"
			style2 = "text-align: center;"

		var/row = 1
		winset(src,"Admin_Quick.usergrid","cells=7x1")

		// Header
		src<<output("<span style=\"[style][style2]\">Chatter</span>","Admin_Quick.usergrid:1,[row]")
		src<<output("<span style=\"[style][style2]\">IP</span>","Admin_Quick.usergrid:2,[row]")
		src<<output("<span style=\"[style][style2]\">CID</span>","Admin_Quick.usergrid:3,[row]")
		src<<output("<span style=\"[style]\"> Kick</span>","Admin_Quick.usergrid:4,[row]")
		src<<output("<span style=\"[style]\"> Mute</span>","Admin_Quick.usergrid:5,[row]")
		src<<output("<span style=\"[style]\"> Ban</span>","Admin_Quick.usergrid:6,[row]")
		src<<output("<span style=\"[style]\"> Info</span>","Admin_Quick.usergrid:7,[row]")
		row++

		// Clients
		InsertSort(Everyone)
		for(var/client/C in Everyone)
			src<<output("<span style=\"[style2]\">[C.name]</span>","Admin_Quick.usergrid:1,[row]")
			src<<output("<span style=\"[style2]\">[C.address]</span>","Admin_Quick.usergrid:2,[row]")
			src<<output("<span style=\"[style2]\">[C.computer_id]</span>","Admin_Quick.usergrid:3,[row]")
			src<<output(Admin_Kick,"Admin_Quick.usergrid:4,[row]")
			if(checkMute(C.ckey))
				src<<output(Admin_Unmute,"Admin_Quick.usergrid:5,[row]")
			else
				src<<output(Admin_Mute,"Admin_Quick.usergrid:5,[row]")
			src<<output(Admin_Ban,"Admin_Quick.usergrid:6,[row]")
			src<<output(Admin_Archive3,"Admin_Quick.usergrid:7,[row]")
			row++

		winset(src,"Admin_Quick.usergrid","cells=7x[row-1]")

	AdminUpdateForgive()
		set hidden = 1
		var
			style = "font-weight: bold; font-size: 12px;"
			style2 = "text-align: center;"
		var/mrow = 1
		var/brow = 1

		// Header
		src<<output("<span style=\"[style][style2]\">Chatter</span>","Admin_Forgive.unmutegrid:1,[mrow]")
		src<<output("<span style=\"[style]\">Remove</span>","Admin_Forgive.unmutegrid:3,[mrow]")
		src<<output("<span style=\"[style]\">Info</span>","Admin_Forgive.unmutegrid:4,[mrow]")
		mrow++

		// Clients
		for(var/C in MuteList)
			src<<output("<span style=\"[style2]\">[C]</span>","Admin_Forgive.unmutegrid:1,[mrow]")
			src<<output(Admin_Unmute2,"Admin_Forgive.unmutegrid:3,[mrow]")
			src<<output(Admin_Archive2,"Admin_Forgive.unmutegrid:4,[mrow]")
			mrow++

		winset(src,"Admin_Forgive.unmutegrid","cells=4x[mrow-1]")

		// Header
		src<<output("<span style=\"[style][style2]\">Chatter</span>","Admin_Forgive.unbangrid:1,[brow]")
		src<<output("<span style=\"[style]\">Remove</span>","Admin_Forgive.unbangrid:3,[brow]")
		src<<output("<span style=\"[style]\">Info</span>","Admin_Forgive.unbangrid:4,[brow]")
		brow++

		for(var/C in Banned)
			src<<output("<span style=\"[style2]\">[C]</span>","Admin_Forgive.unbangrid:1,[brow]")
			src<<output(Admin_Unban,"Admin_Forgive.unbangrid:3,[brow]")
			src<<output(Admin_Archive,"Admin_Forgive.unbangrid:4,[brow]")
			brow++

		winset(src,"Admin_Forgive.unbangrid","cells=4x[brow-1]")



obj
	Interface
		icon='buttons.dmi'
		Kick
			icon_state="kick"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Everyone))
					var/client/person = Everyone[row]
					person = person.key
					usr.client.Administrate(person, "Kick")

		Mute
			icon_state="mute"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Everyone))
					var/client/person = Everyone[row]
					person = person.key
					usr.client.Administrate(person, "Mute")

		Unmute
			icon_state="unmute"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Everyone))
					var/client/person = Everyone[row]
					person = person.key
					usr.client.Administrate(person, "Unmute")

		Unmute2
			icon_state="unmute"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(MuteList))
					var/person = MuteList[row]
					usr.client.Administrate(person, "Unmute")

		Ban
			icon_state="unmute"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Everyone))
					var/client/person = Everyone[row]
					person = person.key
					usr.client.Administrate(person, "Ban",)

		Unban
			icon_state="unmute"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Banned))
					var/person = Banned[row]
					usr.client.Administrate(person, "Unban", "Quickly now, from the list!")

		Archive
			icon_state="archive"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Banned))
					var/person = Banned[row]
					var/ID = ReturnKeyID(person)
					usr.client.ViewID(ID)

		Archive2
			icon_state="archive"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(MuteList))
					var/person = MuteList[row]
					var/ID = ReturnKeyID(person)
					usr.client.ViewID(ID)

		Archive3
			icon_state="archive"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Everyone))
					var/client/person = Everyone[row]
					var/ID = ReturnKeyID(person.key)
					if(ID) usr.client.ViewID(ID)



var/obj/Interface/Admin_Kick = new/obj/Interface/Kick
var/obj/Interface/Admin_Mute = new/obj/Interface/Mute
var/obj/Interface/Admin_Unmute = new/obj/Interface/Unmute
var/obj/Interface/Admin_Unmute2 = new/obj/Interface/Unmute2
var/obj/Interface/Admin_Ban = new/obj/Interface/Ban
var/obj/Interface/Admin_Unban = new/obj/Interface/Unban
var/obj/Interface/Admin_Archive = new/obj/Interface/Archive
var/obj/Interface/Admin_Archive2 = new/obj/Interface/Archive2
var/obj/Interface/Admin_Archive3 = new/obj/Interface/Archive3